#include<iostream>
#include<stack>
#include<queue>

using std::cout;
using std::endl;

void test_stack()
{
	std::stack<int> st;
	st.push(1);
	st.push(2);
	st.push(3);
	st.push(4);

	while (!st.empty())
	{
		cout << st.top() << " ";;
		st.pop();
	}
	cout << endl;//4 3 2 1
}


void test_queue()
{
	std::queue<int> q;
	q.push(1);
	q.push(2);
	q.push(3);
	q.push(4);

	while (!q.empty())
	{
		cout << q.front()<< " ";;
		q.pop();
	}
	cout << endl;//1 2 3 4
}

int main()
{
	test_stack();
	test_queue();



	return 0;
}